<template>
  <!-- 详情 -->
  <el-dialog :visible.sync="dialogVisible" width="50%" append-to-body :close-on-click-modal="false"
    :before-close="closedialog">
    <el-descriptions class="margin-top" title="报文交换记录详情" :column="2" border>
      <el-descriptions-item>
        <template slot="label">
          主键
        </template>
        {{form.id}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          记录类型
        </template>
        {{form.recordType}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          报文ID
        </template>
        {{form.messageId}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          功能代码
        </template>
        {{form.functionCode}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          报文类型
        </template>
        {{form.messageType}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          发送者ID
        </template>
        {{form.sendId}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          接受者ID
        </template>
        {{form.receiverId}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          版本
        </template>
        {{form.version}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          原始报文
        </template>
        {{form.originText}}
      </el-descriptions-item>
    </el-descriptions>
    <div slot="footer" class="dialog-footer" style="text-align: center;">
      <el-button @click="closedialog">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
  import {
    getMftMessageExchageRecord
  } from "@/api/swdecl/mftMessageExchageRecord";
  export default {
    props: {
      detailId: {},
      dict: {}
    },
    data() {
      return {
        //显示详情
        dialogVisible: false,
        form: {
          id: null,
          recordType: null,
          messageId: null,
          functionCode: null,
          messageType: null,
          sendId: null,
          receiverId: null,
          version: null,
          originText: null
        }
      }
    },
    watch: {
      detailId: {
        immediate: true,
        handler(val) {
          if (val) {
            this.loadDetail();
          }
        }
      }
    },
    methods: {
      open() {
        this.dialogVisible = true
      },
      closedialog() {
        this.dialogVisible = false
      },
      // 获取详情
      loadDetail() {
        getMftMessageExchageRecord(this.detailId).then((res) => {
          if (res.code == 200) {
            this.form = res.data;
          }
        });
      },
    }
  };
</script>

<style>
</style>
